import requests
import urllib3
import json

path='https://yuyue.nnhm.org.cn'
get_url = path+"/zrbwght/market/venue/1/2024-09-10"
token='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjI1Nzk1MjUsImlzcyI6IndscCIsImV4cCI6MTcyNTk1MTY1MCwiaWF0IjoxNzI1ODY1MjUwfQ.5LbKvb9GNeJE5uCov8Hm_D9ceIEZFH4fMykF8wQRpc8'
headers = {
"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
"Cookie":"UM_distinctid=18fb95ee8d910-0bbd820ab1021d-26001c51-1fa400-18fb95ee8da82c; __snaker__id=D0pWgfaGGe9WP6Vk",
"Token":token
}

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

session = requests.session()
res = session.post(url=get_url,headers=headers,verify=False)

# res=requests.get(url=get_url,headers=headers,verify=False)
s=res.content
# print(s.decode())
json_str=s.decode()
data1 = json.loads(json_str)
if (data1['code']=='SUCCESS'):
    print('请求成功')
    data1_data=data1['data']
    # print(len(data1_data))
    zt_times=data1_data['priceTypeList']
    print(len(zt_times))
    for ztt in zt_times:
        # print(ztt)
        if(ztt['PriceTypeID']==150):
            # print(ztt)
            if(ztt['TotalRemain']>0):
                print(ztt)
        if(ztt['PriceTypeID']==151):
            # print(ztt)
            if(ztt['TotalRemain']>0):
              print(ztt)
              plPath=path+'/zrbwght/contacter/list/2579525'
              res = session.post(url=plPath,headers=headers,verify=False)
              s=res.content
              json_str=s.decode()
              print(json_str)




                





